package com.ttbj.product.bean.dto;

import java.io.Serializable;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.springframework.util.StringUtils;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.ttbj.constant.GenerateNumConstants;
import com.ttbj.util.DateUtils;
import com.ttbj.util.TokenUtils;

@JsonInclude(Include.NON_NULL)
public class CargoDto implements Serializable {
	
	private static final long serialVersionUID = -956563172059438865L;


	private Long cargoId;

	
    private String cargoNum;

    /**
     * 订单编号
     */
    private String cargoOrderNum;

    /**
     * 货物数量
     */
    @Min(value=1,message="货物数量不允许小于等于0")
    @NotNull(message ="请填写货物数量，货物数量不能为空")
    private Integer cargoAmount;

    /**
     * 高度
     */
    @DecimalMin (value="0.01",message="货物高度不允许小于等于0")
    @NotNull(message ="请填写货物高度，货物高度不能为空")
    private Float cargoHeight;
    /**
     * 重量
     */
    @DecimalMin (value="0.01",message="货物重量不允许小于等于0")
    @NotNull(message ="请填写货物重量，货物重量不能为空")
    private Float cargoWeight;

    /**
     * 体积
     */
    private Float cargoVolume;

    /**
     * 长度
     */
    @DecimalMin (value="0.01",message="货物长度不允许小于等于0")
    @NotNull(message ="请填写货物长度，货物长度不能为空")
    private Float cargoLong;

    /**
     * 宽度
     */
    @DecimalMin (value="0.01",message="货物宽度不允许小于等于0")
    @NotNull(message ="请填写货物宽度，货物宽度不能为空")
    private Float cargoWide;

    
    private String cargoName;

    private Integer cargoIsCheck;

    private Integer cargoIsXcheck;

    private Integer orderState;

    private Float cargoPay;

    private String cargoUpdateTime;

    private String cargoInsTime;

    private Integer cargoIsDelete;
    
    private String cargoTypeName;

    private String cargoPicOne;

    private String cargoPicTwo;

	public Long getCargoId() {
		return cargoId;
	}

	public void setCargoId(Long cargoId) {
		this.cargoId = cargoId;
	}

	public String getCargoNum() {
		return cargoNum;
	}

	public void setCargoNum(String cargoNum) {
		this.cargoNum = cargoNum;
	}

	public String getCargoOrderNum() {
		return cargoOrderNum;
	}

	public void setCargoOrderNum(String cargoOrderNum) {
		this.cargoOrderNum = cargoOrderNum;
	}

	public Integer getCargoAmount() {
		return cargoAmount;
	}

	public void setCargoAmount(Integer cargoAmount) {
		this.cargoAmount = cargoAmount;
	}

	public Float getCargoHeight() {
		return cargoHeight;
	}

	public void setCargoHeight(Float cargoHeight) {
		this.cargoHeight = cargoHeight;
	}

	public Float getCargoWeight() {
		return cargoWeight;
	}

	public void setCargoWeight(Float cargoWeight) {
		this.cargoWeight = cargoWeight;
	}

	public Float getCargoVolume() {
		return cargoVolume;
	}

	public void setCargoVolume(Float cargoVolume) {
		this.cargoVolume = cargoVolume;
	}

	public Float getCargoLong() {
		return cargoLong;
	}

	public void setCargoLong(Float cargoLong) {
		this.cargoLong = cargoLong;
	}

	public Float getCargoWide() {
		return cargoWide;
	}

	public void setCargoWide(Float cargoWide) {
		this.cargoWide = cargoWide;
	}

	public String getCargoName() {
		return cargoName;
	}

	public void setCargoName(String cargoName) {
		this.cargoName = cargoName;
	}

	public Integer getCargoIsCheck() {
		return cargoIsCheck;
	}

	public void setCargoIsCheck(Integer cargoIsCheck) {
		this.cargoIsCheck = cargoIsCheck;
	}

	public Integer getCargoIsXcheck() {
		return cargoIsXcheck;
	}

	public void setCargoIsXcheck(Integer cargoIsXcheck) {
		this.cargoIsXcheck = cargoIsXcheck;
	}

	public Integer getOrderState() {
		return orderState;
	}

	public void setOrderState(Integer orderState) {
		this.orderState = orderState;
	}

	public Float getCargoPay() {
		return cargoPay;
	}

	public void setCargoPay(Float cargoPay) {
		this.cargoPay = cargoPay;
	}

	public String getCargoUpdateTime() {
		return cargoUpdateTime;
	}

	public void setCargoUpdateTime(String cargoUpdateTime) {
		this.cargoUpdateTime = cargoUpdateTime;
	}

	public String getCargoInsTime() {
		return cargoInsTime;
	}

	public void setCargoInsTime(String cargoInsTime) {
		this.cargoInsTime = cargoInsTime;
	}

	public Integer getCargoIsDelete() {
		return cargoIsDelete;
	}

	public void setCargoIsDelete(Integer cargoIsDelete) {
		this.cargoIsDelete = cargoIsDelete;
	}

	public String getCargoTypeName() {
		return cargoTypeName;
	}

	public void setCargoTypeName(String cargoTypeName) {
		this.cargoTypeName = cargoTypeName;
	}

	public String getCargoPicOne() {
		return cargoPicOne;
	}

	public void setCargoPicOne(String cargoPicOne) {
		this.cargoPicOne = cargoPicOne;
	}

	public String getCargoPicTwo() {
		return cargoPicTwo;
	}

	public void setCargoPicTwo(String cargoPicTwo) {
		this.cargoPicTwo = cargoPicTwo;
	}


	public CargoDto insTime() {
		this.cargoInsTime = DateUtils.getCurDttStr();
		return this;
	}

	public CargoDto no() {
		this.cargoNum = TokenUtils.getNo(GenerateNumConstants.CARGO);
		return this;
		
	}

	public CargoDto picOne(String cargoPic1) {
		if (!StringUtils.isEmpty(cargoPic1)){
			this.cargoPicOne = cargoPic1;
		}
		return this;
	}

	public CargoDto picTwo(String cargoPic2) {
		if(!StringUtils.isEmpty(cargoPic2)){
			this.cargoPicTwo = cargoPic2;
		}
		return this;
		
	}

	public CargoDto orderNum(String orderNum) {
		this.cargoOrderNum = orderNum;
		return this;
	}

	@Override
	public String toString() {
		return "CargoDto [cargoId=" + cargoId + ", cargoNum=" + cargoNum + ", cargoOrderNum=" + cargoOrderNum + ", cargoAmount=" + cargoAmount + ", cargoHeight=" + cargoHeight + ", cargoWeight=" + cargoWeight + ", cargoVolume=" + cargoVolume + ", cargoLong=" + cargoLong + ", cargoWide=" + cargoWide
				+ ", cargoName=" + cargoName + ", cargoIsCheck=" + cargoIsCheck + ", cargoIsXcheck=" + cargoIsXcheck + ", orderState=" + orderState + ", cargoPay=" + cargoPay + ", cargoUpdateTime=" + cargoUpdateTime + ", cargoInsTime=" + cargoInsTime + ", cargoIsDelete=" + cargoIsDelete
				+ ", cargoTypeName=" + cargoTypeName + ", cargoPicOne=" + cargoPicOne + ", cargoPicTwo=" + cargoPicTwo + "]";
	}
	
    

}
